Appium与Android 7的恩怨纠葛

  1. Locator Strategy ‘name’ is not supported for this session
    Appium不支持name定位了,改用xpath

    1
    xpath=//*[@text="上传附件"]
  2. WebDriverException: Message: Parameters were incorrect. We wanted {“required”:[“value”]} and you sent [“value”,”text”]
    Appium的bug,Selenium降级到3.3.1搞定

    1
    2
    pip uninstall selenium
    pip install selenium==3.3.1
  3. android.support.test.uiautomator.StaleObjectException
    查了下,大概意思是说缓存的对象发生变化时,再访问就无效了。一般发生在某些状态会改变的按钮,第二次点击的时候。解决方法是第二次点击之前再find一次。
    不过比较奇怪的是,我这好几个按钮第一次点击就报这个错误,点击前加了sleep 2解决了。

欢迎打赏!